﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace taurus.client
{
    public enum PackMode
    {
        Write,
        Read
    }

    public interface IFilePack
    {
        /// <summary>
        /// 打包文件
        /// </summary>
        /// <param name="dirPath">文件所在目录</param>
        void PackFile(string dirPath);

        /// <summary>
        /// 打包文件
        /// </summary>
        /// <param name="dirPath">文件所在目录</param>
        /// <param name="filter">列如".jpg|.png"过滤jpg和png文件</param>
        void PackFile(string dirPath, string filter);

        /// <summary>
        /// 打包文件
        /// </summary>
        /// <param name="dirPath">文件所在目录</param>
        /// <param name="fileList">文件列表</param>
        void PackFile(string dirPath, List<string> fileList);

        /// <summary>
        /// 异步打包文件
        /// </summary>
        /// <param name="dirPath">文件所在目录</param>
        void PackFileSyn(string dirPath);

        /// <summary>
        /// 打包文件
        /// </summary>
        /// <param name="dirPath">文件所在目录</param>
        /// <param name="filter">列如".jpg|.png"过滤jpg和png文件</param>
        void PackFileSyn(string dirPath, string filter);

        /// <summary>
        /// 打包文件
        /// </summary>
        /// <param name="dirPath">文件所在目录</param>
        /// <param name="fileList">文件列表</param>
        void PackFileSyn(string dirPath, List<string> fileList);

        /// <summary>
        /// 解压到指定文件夹
        /// </summary>
        /// <param name="dirPath">文件夹</param>
        void UnPackFileSyn(string dirPath);

        /// <summary>
        /// 解压到指定文件夹
        /// </summary>
        /// <param name="dirPath">文件夹</param>
        void UnPackFile(string dirPath);

        /// <summary>
        /// 当前进度
        /// </summary>
        float Progress { get; }

        /// <summary>
        /// 是否压缩或者解压完成
        /// </summary>
        bool Complete { get; }

        /// <summary>
        /// 打包错误描述
        /// </summary>
        string Error { get; }

        /// <summary>
        /// 根目录
        /// </summary>
        string RootDir { set; }
    }
}
